HTMLify

index.html
Views: 67 | Author: cody
<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title>Glowing Gradient Effect On Mouse Move</title>
    <meta name='viewport' content='width=device-width, initial-scale=1'>
    <link rel='stylesheet' type='text/css' media='screen' href='style.css'>
</head>

<body>
    <div id="blob"></div>
    <div id="blur"></div>

    <script>
        const blob = document.getElementById("blob");

        window.onpointermove = (event) => {
            const { clientX, clientY } = event;

            blob.animate(
                {
                    left: `${clientX}px`,
                    top: `${clientY}px`
                },
                { duration: 3000, fill: "forwards" }
            );
        };
    </script>
</body>

</html>

Comments